﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BiffenGUI.BiffenService;

namespace BiffenGUI.UserControls
{
    public partial class MovieDetails : UserControl
    {
        private Movie movie = null;
        private MemberAddBookingCurrent parent = null;
        private bool disableClick = false;

        public MovieDetails()
        {
            InitializeComponent();
        }

        public void Update(Movie m, MemberAddBookingCurrent p, bool disableClick)
        {
            movie = m;
            parent = p;
            this.disableClick = disableClick;

            lblTitle.Text = m.Title + " (" + m.Year.ToString() + ")";
            lblActors.Text = m.Actors;
            lblDirectors.Text = m.Directors;
            lblLength.Text = m.Duration + " min.";
            lblSummary.Text = m.Summary;

            if (disableClick)
                this.Cursor = Cursors.Default;
        }


        public void Update(Movie m)
        {
            Update(m, null, true);
        }

        public void Update(Movie m, MemberAddBookingCurrent p)
        {
            Update(m, p, false);
        }

        public Movie Movie()
        {
            return movie;
        }

        private void MovieDetails_Click(object sender, EventArgs e)
        {
            if (!disableClick)
                parent.NextStep(movie);
        }

        private void MovieDetailsLabels_Click(object sender, EventArgs e)
        {
            MovieDetails_Click(this, e);
        }

    }
}
